import React, { useState, useRef } from 'react';
import BeforeIssue from './BeforeIssue';
import HomeAll from '../Overview/HomeAll';
import { getLocalStorageInfo } from '@/utils/localStorageInfo';

export default () => {
  const [isIssue, setIsIssue] = useState(false);
  React.useEffect(() => {
    let tenantDao = getLocalStorageInfo('tenantDao');
    if (tenantDao.hasToken === '1') setIsIssue(true);
  }, []);
  return (
    <>
      {isIssue ? (
        // 已发行展示积分总览
        <HomeAll />
      ) : (
        // 未发行
        <BeforeIssue setIsIssue={setIsIssue} />
      )}
    </>
  );
};
